package com.hgz.sbj.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hgz.sbj.model.TFxItem;
import com.hgz.sbj.service.TFxItemService;

@Controller
@RequestMapping("/web")
public class SwaggerController {
    
	@Autowired
	private TFxItemService tFxItemService;
	
    /*
     *  http://localhost:8080/swagger/index.html
     */
 
    @RequestMapping("/getItems")
    @ResponseBody
    public TFxItem getItems(){
    	List<TFxItem> list = tFxItemService.getBeans();
        return list.get(0);
    }
    
    @RequestMapping("/item")
    public String itemsView(Model model){
    	/*List<TFxItem> list = tFxItemService.getBeans();
    	model.addAttribute("list", list);*/
    	return "item";
    }
}
